package com.prd.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.prd.config.LoginInterceptor;
import com.prd.dto.SummaryVoteDto;
import com.prd.mapper.EntMeetMakeMapper;
import com.prd.model.EntMeetMake;
import com.prd.model.LoginUser;
import com.prd.service.EntMeetMakeService;
import com.prd.util.UserInfoUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EntMeetMakeServiceImpl extends ServiceImpl<EntMeetMakeMapper, EntMeetMake> implements EntMeetMakeService {

    @Autowired
    private EntMeetMakeMapper entMeetMakeMapper;

    @Override
    public int insertInfo(EntMeetMake entMeetMake) {
        LoginUser loginUser = LoginInterceptor.threadLocal.get();
        BeanUtils.copyProperties(UserInfoUtil.recordInfo(loginUser.getId(), loginUser.getName(), true), entMeetMake);
        return entMeetMakeMapper.insert(entMeetMake);
    }
}
